{extend name="admin@public/base" /}
{block name="main-content"}
<div class="page-content">
    <div class="row">
        <div class="col-xs-12">
            <div>
                <ul class="nav nav-tabs">
                    <li class="{eq name='$tab_type' value='1'}active{/eq}"><a href="{:url('Message/mySendMessageList',array('tab_type'=>1))}">通知公告</a></li>
                    <li class="{eq name='$tab_type' value='2'}active{/eq}"><a href="{:url('Message/mySendMessageList',array('tab_type'=>2))}">站内消息</a></li>
                </ul>
                <table class="table table-striped table-bordered table-hover" id="dynamic-table">
                    <thead>
                        <tr>
                            <th class="center">编号</th>
                            <th class="hidden-sm hidden-xs center" width="40%">标题</th>
                            <th class="center">发送时间</th>
                            <th class="center">状态</th>
                            <th class="center">操作</th>
                        </tr>
                    </thead>

                    <tbody>
                        {empty name="messageContentList"}
                        <tr> <td colspan="5" class="center">未查询到相关数据  </td> </tr>
                        {else /} 
                        {foreach name="messageContentList" item="v"}
                        <tr>
                            <td height="28" class="center">{$v.id}</td>
                            <td class="hidden-sm hidden-xs center"><a href="javascript:void(0);" onclick="view_message_info('{$v.id}', 'mysend')" >{$v.title}</a></td>
                            <td class="center">{$v.send_time|date="Y-m-d H:i",###}</td>
                            <td class="center">
                                <span class="label label-lg {eq name='$v.send_status' value='0'} label-danger {else} label-yellow {/eq} " >{$messageStatus[$v.send_status]}</span>
                            </td>
                            <td class="center">
                                <div class="hidden-sm hidden-xs action-buttons">
                                    <a href="{:url('admin/Message/editMessageContent',array('message_id'=>$v['id']))}" class="tooltip-success" data-rel="tooltip" title="" data-original-title="编辑">
                                        <span class="green">
                                            <i class="ace-icon fa fa-pencil-square-o bigger-110">编辑</i>
                                        </span>
                                    </a>
                                    <a class="red confirm-rst-url-btn" data-info="你确定要删除吗？" href="{:url('Message/delMessageByConentId',array('message_id'=>$v['id'],'tab_type'=>$tab_type))}" title="删除">
                                        <i class="ace-icon fa fa-trash-o bigger-110">删除</i>
                                    </a>
                                </div>
                            </td>
                        </tr>
                        {/foreach}
                        {notempty name="$page"}
                        <tr>
                            <td height="50" colspan="10" align="left">{$page}</td>
                        </tr>
                        {/notempty}
                        {/empty}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="scripts"}
<script>
    function view_message_info(message_id, type) {
        var title = "消息详情";
        var url = '{:url("Message/viewMessageInfo")}?messageId=' + message_id + '&type=' + type;
        layer.open({
            type: 2,
            shadeClose: true,
            shade: 0.5,
            area: ['850px', '80%'],
            title: title,
            content: url
        });
    }

</script>
{/block}